<?php
namespace app\behavior;
use think\Cache;
use data\service\Version;
use \think\Session as Session;
\think\Loader::addNamespace('data', 'data/');

class CheckAuthor extends \think\Controller
{

    public function run()
    {
        /* if(!file_exists(ROOT_PATH.'version.php') || !file_exists(ROOT_PATH.'/application/platform/controller/Versions.php') || !file_exists(ROOT_PATH.'/data/service/Version.php') || !file_exists(ROOT_PATH.'/thinkphp/sourceAuthorization.html'))
        {
            $this->error('授权代码有误，请联系平台');
        }
        $version_data = include(ROOT_PATH.'version.php');
        if(empty($version_data['version_num']) || empty($version_data['secret_key'])){
            $this->error('授权代码有误，请联系平台');
        }
        $cache = Session::get("vsl_version");
        if(empty($cache)){
            $version = new Version();
            $res =$version->checkSecret();
            Session::set('vsl_version',24*3600);
            if($res['code']<0){
                $this->error('授权代码有误，请联系平台');
            }
        } */
    }
}
